Skip to content

Enable -D lua-vanilla for Lua tests, removing luarocks dependencies#175

Merged
Simn merged 3 commits into
masterfrom
copilot/investigate-hxcoro-tests-lua-vanilla
Jul 3, 2026
Merged

Enable -D lua-vanilla for Lua tests, removing luarocks dependencies#175
Simn merged 3 commits into
masterfrom
copilot/investigate-hxcoro-tests-lua-vanilla

Conversation

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

The Lua CI target required luv, lrexlib-pcre2, luautf8, and bit32 via luarocks. With -D lua-vanilla and Lua 5.4 as minimum, none of these are needed — but several runtime blockers existed.

Blockers fixed

  • Sys.getEnv() in Main.hx — Guard the HXCORO_DISPATCHER dispatcher-selection block with #if (sys && !lua_vanilla) since Sys.getEnv throws in vanilla mode.

  • Sys.sleep() in BackOff.hx — Used in the event-loop busy-wait; not available in vanilla mode. Added a #elseif lua_vanilla no-op branch before the existing #elseif sys one.

  • Sys.time() via Timer.milliseconds()HeapScheduler.now()Timer.milliseconds()Timer.stamp()Sys.time(), which throws in vanilla mode. Added a #if lua_vanilla branch in HeapScheduler.now() using lua.Os.clock() instead.

Build file changes

tests/build-lua.hxml and callstack-tests/build-lua.hxml now include:

-D lua-vanilla

CI changes

The Setup Lua step in main.yml is reduced to just installing lua5.4 — all luarocks packages (luv, lrexlib-pcre2, luautf8, bit32) are removed.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: Simn <634365+Simn@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate hxcoro tests with -D lua-vanilla Enable -D lua-vanilla for Lua tests, removing luarocks dependencies Mar 18, 2026
Copilot AI requested a review from Simn March 18, 2026 16:08
Copilot finished work on behalf of Simn March 18, 2026 16:08
@Simn

Simn commented Mar 25, 2026

Copy link
Copy Markdown
Member

@copilot Haxe has had some changes for better lua-vanilla support, see HaxeFoundation/haxe#12599. Please confirm that you're on commit c4c8605af68e2b3fe5f8e35d880fbf6786d15557 and then see if the bit-op-related workarounds here can be removed now!

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Haxe has had some changes for better lua-vanilla support, see HaxeFoundation/haxe#12599. Please confirm that you're on commit c4c8605af68e2b3fe5f8e35...

Confirmed on c4c8605. The updated _hx_bit.lua now tries native Lua 5.4 bitwise operators first (before falling back to bit32/bit), so _hx_bit is never the error stub on Lua 5.4. Removed LuaVanillaBitPatch.hx, restored MinimumHeap.hx to the original bit-shifts, and dropped --macro include("hxcoro.lua") from the build files.

The Sys.time() workaround in EventLoopScheduler.now() and the Sys.sleep() no-op in BackOff.hx are still needed since Timer.stamp()Sys.time() still throws in lua-vanilla mode and that hasn't changed in c4c8605.

Commit: edef8cf

Copilot finished work on behalf of Simn March 25, 2026 13:08
@Simn Simn marked this pull request as ready for review July 3, 2026 11:55
@Simn Simn merged commit 4b1a4d4 into master Jul 3, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants